package cn.kwq.project_manger.pojo.dto;

import cn.hutool.core.util.DesensitizedUtil;
import cn.kwq.project_manger.pojo.Project;
import cn.kwq.project_manger.pojo.Team;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "队伍返回对象")
public class ResTeamDto {
    @ApiModelProperty("队伍id(更新信息时候传)")
    private Long teamId;


    /**
     * 队伍名字
     */
    @ApiModelProperty("队伍名字")
    private String teamName;

    /**
     * 总共人数
     */
    @ApiModelProperty("总共人数")
    private Integer teamNum;

    /**
     * 队伍情况
     */
    @ApiModelProperty("队伍情况")
    private String situation;

    /**
     * 发起人姓名
     */
    @ApiModelProperty("发起人姓名")
    private String originators;

    /**
     * 队伍目标
     */
    @ApiModelProperty("队伍目标")
    private String goal;

    /**
     * 招收对象
     */
    @ApiModelProperty("招收对象")
    private String recruit;

    /**
     * 类型 0为组织 1个人
     */
    @ApiModelProperty("类型 0为组织 1个人")
    private Integer type;

    /**
     * 联系方式
     */
    @ApiModelProperty("联系方式")
    private String connect;

    /**
     * 招收对象需求
     */
    @ApiModelProperty("招收对象需求")
    private String recruitNeed;


    @ApiModelProperty(value = "队长id")
    private Long captionId;

    /**
     * 组队类型 直接传比赛，项目，其他自定义
     */
    @ApiModelProperty("组队类型 直接传比赛，项目，其他自定义")
    private String groupType;

    @ApiModelProperty(value = "标签")
    private List<String> tags;


    @ApiModelProperty("队员信息")
    private  List<String> member;

    @ApiModelProperty("队员信息（带id版本）")
    private  List<String> membersId;

    @ApiModelProperty("关联的比赛或者项目的信息数组")
    private List<Project> projects;

    @ApiModelProperty
    private String teamProjectName;

    public void Project(List<Project> project){
        this.projects=project;
    }

    public void Member(List<String> members){
        this.member=members;
    }

    public void Tags(List<String> listTags){
        this.tags=listTags;
    }

    public void MembersId(List<String> list){
        this.membersId=list;

    }


    public void Team(Team t){
                this.teamId=t.getTeamId();
                this.teamName=t.getTeamName();
                this.teamNum=t.getTeamNum();
                this.situation=t.getSituation();
                this.originators=DesensitizedUtil.chineseName(t.getOriginators());//脱敏
                this.goal=t.getGoal();
                this.recruit=t.getRecruit();
                this.type=t.getType();
                this.connect= DesensitizedUtil.mobilePhone(t.getConnect());//脱敏
                this.recruitNeed=t.getRecruitNeed();
                this.teamProjectName=t.getTeamProjectName();
                this.groupType=t.getGroupType();
    }
}
